<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // let arr = []
        // arr[0] = 1
        // arr[1] = 4
        // console.log(arr);

        let arr = ['pink', 'red', 'green']
        // 修改
        arr[0] = 'hotpink'
        // console.log(arr);
        // 给所有数组元素后面加老师
        for (let i = 0; i < arr.length; i++) {
            arr[i] = arr[i] + '老师'
        }
        console.log(arr);
        // 增加 push是从后面添加
        arr.push('lucy', 'coooke', 'dalin')
        console.log(arr);

    </script>
</body>

</html>